<%--
  Created by IntelliJ IDEA.
  User: Lenovo
  Date: 2022/6/7
  Time: 16:47
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
    <meta charset="UTF-8">
    <title>所有药品库存</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../layui/css/layui.css"  media="all">
    <style>

    </style>
</head>
<body style="text-align: center">
<table cellspacing="0" cellpadding="0" border="0" class="layui-table">
    <thead class="layui-table-header">
    <tr>
        <th>ID</th>
        <th>药品名</th>
        <th>厂商</th>
        <th>供货商</th>
        <th>生产日期</th>
        <th>单价</th>
        <th>入库/分发量</th>
        <th>入库日期</th>
        <th>保质期</th>
        <th>库存量</th>
    </tr>
    </thead>
    <tbody>
    <c:if test="${empty list}">
        <tr class="layui-table-cell laytable-cell-1-0-3">
            <td colspan="3">没有数据</td>
        </tr>
    </c:if>
    <c:if test="${not empty list}">
        <c:forEach var="drugs" items="${list}">
            <tr class="layui-table-cell laytable-cell-1-0-3">
                <td align="center">${drugs.id}</td>
                <td align="center">${drugs.name}</td>
                <td align="center">${drugs.vendor}</td>
                <td align="center">${drugs.deliveryUnit}</td>
                <td align="center">${drugs.createDate}</td>
                <td align="center">${drugs.price}</td>
                <td align="center">${drugs.changeNumber}</td>
                <td align="center">${drugs.storageDate}</td>
                <td align="center">${drugs.life}</td>
                <td align="center">${drugs.number}</td>
            </tr>
        </c:forEach>
    </c:if>

    <tr class="layui-table-cell laytable-cell-1-0-3">
        <td align="center" colspan="10">
            <span>共${PageUtils.totalPages}页，${PageUtils.totalCount}条数据</span>
            <a href="drugsLimit?index=1">首页</a>
            <c:if test="${PageUtils.currentIndex != 1}">
                <a href="drugsLimit?index=${PageUtils.currentIndex - 1}">上一页</a>
            </c:if>

            <c:if test="${PageUtils.currentIndex == 1}">
                <a href="javascript:void(0)">上一页</a>
            </c:if>

            <span>第${PageUtils.currentIndex}页</span>

            <c:if test="${PageUtils.currentIndex != PageUtils.totalPages}">
                <a href="drugsLimit?index=${PageUtils.currentIndex + 1}">下一页</a>
            </c:if>

            <c:if test="${PageUtils.currentIndex == PageUtils.totalPages}">
                <a href="javascript:void(0)">下一页</a>
            </c:if>

            <a href="drugsLimit?index=${PageUtils.totalPages}">尾页</a>
            <a href="getDrugs.html">返回</a>
        </td>
    </tr>

    </tbody>
</table>
</body>
</html>
